package com.tianzeculture.stagebao.net;

import com.tianzeculture.stagebao.bean.MyResultBean;
import com.tianzeculture.stagebao.bean.ResultBean;
import com.tianzeculture.stagebao.net.base.AppBaseRestUsageV2;
import com.tianzeculture.stagebao.network.net.httpclient.NewCustomResponseHandler;
import com.tianzeculture.stagebao.util.Util;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/7/24 0024.
 * 个人标签
 */

public class TagRestUsage extends AppBaseRestUsageV2 {

    private String TAG_LIST = "/tag/tagList.do";//个人标签

    //    saveAttention
    private String SAVEATTENTION = "/attention/saveAttention.do";//关注
    private String CANCEL_ATTENTION = "/attention/cancelAttention.do";//取消关注
    private String GET_ATTENTIONLIST = "/attention/fanList.do";//关注列表
    private String GET_FANLIST = "/attention/attentionList.do";//粉丝列表
    //    private String GET_TAGLIST = "/tag/getTagList.do";//获取标签列表
    private String GET_TAGLIST = "/tag/getByParTagList.do";//获取标签列表

    /**
     * 个人标签
     */
    public void tagList(int taskId) {
        Map<String, String> paramMap = new HashMap<>();
        post(TAG_LIST, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 关注
     */
    public void saveAttention(int taskId, String attentionUserId) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("attentionUserId", attentionUserId);
        post(SAVEATTENTION, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 取消关注
     */
    public void cancleAttention(int taskId, String attentionUserId) {
        Map<String, String> paramMap = new HashMap<>();
        paramMap.put("id", attentionUserId);
        post(CANCEL_ATTENTION, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 粉丝列表
     */
    public void getFansList(int taskId) {
        Map<String, String> paramMap = new HashMap<>();
        post(GET_FANLIST, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 关注列表
     */
    public void getAttentionList(int taskId) {
        Map<String, String> paramMap = new HashMap<>();
        post(GET_ATTENTIONLIST, Util.returnRealParam(paramMap), new NewCustomResponseHandler<ResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }

    /**
     * 获取标签数据
     */
    public void getTatList(int taskId) {
        Map<String, String> paramMap = new HashMap<>();
        post(GET_TAGLIST, Util.returnRealParam(paramMap), new NewCustomResponseHandler<MyResultBean>(taskId) {
        }.setCallSuperRefreshUI(true));
    }
}
